// 接单大厅
import http from '../utils/http.js';

/**
 * 接单大厅查询
*/
export const getReceivingHall = (data) => {
  return http.get('/auth/rider/order/page',data)
}

/**
 * 接单
*/
export const getReceiving = (shipId) => {
  return http.post(`/auth/rider/order/delivery/${shipId}`)
}

/**
 * 取消接单
 */
export const CancelAnOrder = (shipId) =>{
    return http.post(`/auth/rider/order/cancel/${shipId}`)
}

/**
 * 开始配送
*/
export const StartDelivery = (shipId)=>{
    return http.post(`/auth/rider/order/start/${shipId}`)
}

/**
 * 我已送达
 * */ 
export const IHaveDelivered = (shipId)=>{
    return http.post(`/auth/rider/order/arrived/${shipId}`)
}

/**
 * 召唤骑手
*/
export const CallRider = (data)=>{
    return http.post(`/auth/user-store/order/ship/call`,data)
}

/**
 * 商家发货
  */
 export const MerchantDelivery = (data)=>{
    return http.post(`/auth/user-store/order/ship`,data)
 }

 /**
  * 商家订单查询
  */
 export const MerchantOrderQuery = (data)=>{
    return http.get(`/auth/user-store/order/page`,data)
 }

/**
 * 用户发起提现
 */
export const UserInitiatesWithdrawal = (data)=>{
    return http.post(`/auth/balance/withdraw` , data)
}

/**
 * 用户发起提现查询
*/
export const UserInitiatesWithdrawalQuery = ()=>{
    return http.get(`/auth/balance/withdraw/query`)
}

/**
 * 用户收益
 * GET
 * /auth/rider/rebate
 */
export const userRebate = ()=>{
    return http.get(`/auth/rider/rebate`)
}

/**
 * 商家订单查询
 * GET
 * /auth/user-store/order/page
 */
export const GetStoreOrder = (data)=>{
    return http.get('/auth/user-store/order/page',data)
}

 /**
  * 店铺收益
 */
 export const ShopIncome = (data)=>{
    return http.get(`/auth/user-store/profit`,data)
}

/**
 * 商家核销
 * GET
 * /order/receive/store/{orderId}"
*/
export const MerchantWriteOff = (orderId)=>{
    return http.put(`/order/receive/store/${orderId}`)
}

/**
 * 用户发起提现查询
 * POST
 * /auth/balance/withdraw/query/{resource}
*/
export const userQuery = (resource)=>{
    return http.post(`/auth/balance/withdraw/query/${resource}`)
}

/**
 * 用户发起提现
 * POST
 * /auth/balance/withdraw
 */
export const userWithdraw = (data)=>{
    return http.post(`/auth/balance/withdraw`, data)
}

/**
 * 提现记录
 * GET
 * /auth/balance/withdraw/page
 */
export const WithdrawalRecord = (data)=>{
    return http.get('/auth/balance/withdraw/page',data)
}

/**
 * 获取全部的金额类型
 * GET
 * /withdraw/all/query
 */
export const GetAllMoneyType = ()=>{
    return http.get('/auth/balance/withdraw/all/query')
}

/**
 * 收入记录
 * GET
 * /auth/balance/balance/page
 */
export const balancePage = ()=>{
    return http.get('/auth/balance/balance/page')
}
